<?php
/**
* Copyright 2009 Waag Society <http://www.waag.org>
* This file is part of Annotrax.
*
* Annotrax is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* Annotrax is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Annotrax.
* If not, see http://www.gnu.org/licenses/gpl.html
*/

?>
<?php
/**
 * This is the main layout script for Annotrax-admin pages
 */
$title = isset($this->pageTitle) ? '- ' . strip_tags($this->pageTitle) : '';
$request = Zend_Controller_Front::getInstance()->getRequest();
?>
<?php echo $this->doctype(); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<?php
	echo $this->headTitle( sprintf( '%s %s', 'Annotrax', $title ));
	?>
    <link rel="shortcut icon" href="<?php echo $this->themeUrl() ?>favicon.ico">
	<link type="text/css" rel="stylesheet" media="all" href="<?php echo $this->themeUrl() ?>css/admin.css" />
    <?php echo $this->layout()->headSection ?>
	<?php echo $this->headScript() ?>
	<?php echo $this->headLink() ?>
</head>
<body class="yui-skin-sam">
<div id="head" class="section">
	<h1 id="pageTitle">
		<a href="/">
			<img src="<?php echo $this->themeUrl() ?>css/annotrax_logo.jpg" />
        </a>
	</h1>
	<div class="buttonBar">
        <?php if( At_User::getInstance()->hasIdentity() ): ?>
            Hello, <a href="/admin/user/profile"><?php echo At_User::getInstance()->getIdentity()->name ?> (profile)</a> | <a href="/admin/user/logout">Logout</a>
        <?php endif; ?>
	</div>
</div>
<div id="nav">
	<div class="section">
	<?php if( At_User::getInstance()->hasIdentity() ): ?>
		<?php foreach( array('movie', 'channel', 'keyword', 'page', 'annotation', 'setting') as $name ): ?>
			<a class="<?php echo $request->controller == $name ? 'active' : '' ?>" href="/admin/<?php echo $name ?>"><?php echo $name ?>s</a>
		<?php endforeach; ?>
    <?php endif; ?>
	</div>
</div>
<div id="controller">
	<div class="section">
	<?php echo $this->layout()->content ?>
	</div>
</div>
